
import bodyParser from 'koa-bodyparser'
import session from 'koa-session'
import logger from 'koa-logger'
import cors from 'koa2-cors'
import helmet from 'koa-helmet'

export const addBodyParser = app => {
  app.use(bodyParser())
}

export const addLogger = app => {
  app.use(logger())
}

export const addCors = app => {
  app.use(cors())
}

export const addHelmet = app => {
  app.use(helmet())
}

export const addSession = app => {
  app.keys = ['goodqd.net']

  const CONFIG = {
    key: 'goodqd.net',
    maxAge: 86400000,
    overwrite: true,
    httpOnly: false,
    signed: true,
    rolling: false
  }
  app.use(session(CONFIG, app))
}





